package ltd.dujiabao.eduservice.entity.subject;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.ArrayList;
import java.util.List;

/**
 * @author : DuJiabao
 * @Project : online-course-project
 * @Time : 2021/4/21 10:28
 * @Desc : 一级分类
 */
@Data
@Accessors(chain = true)
public class PrimarySubject{
  private String id;
  private String label;
  private List<SecondarySubject> children = new ArrayList<>();

  public PrimarySubject() {
  }

  public PrimarySubject(String id, String label) {
    this.id = id;
    this.label = label;
  }

  public PrimarySubject addSecondarySubject(SecondarySubject secondarySubject) {
    children.add(secondarySubject);
    return this;
  }
}
